﻿<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
	<class name="YiLe.Model.Domain.User, YiLe.Model" table="Users" lazy="true">
		<id name="UserID" column="UserID" type="int">
			<generator class="native"/>
		</id>
		<property name="UserName" column="UserName" type="string" length="50"/>
		<property name="UserSex" column="UserSex" type="string" length="1"/>
		<property name="LoginName" column="LoginName" type="string" length="50"/>
		<property name="LoginPWD" column="LoginPWD" type="string" length="50"/>
		<!-- 多对多关系：User有多个Role inverse="true" cascade="all"-->
		<bag name="Roles" table="Users_Roles" lazy="false">
			<key column="UserID"/>
			<many-to-many column="RoleID" class="YiLe.Model.Domain.Role, YiLe.Model"/>
		</bag>
	</class>
</hibernate-mapping>